package io;

import java.io.*;
import java.nio.charset.StandardCharsets;

public class PWDemo {
    public static void main(String[] args) throws IOException {
        PrintWriter pw = new PrintWriter("pw.txt");
        pw.println("你话都没说");
        pw.println("却哭了很久很久");
        pw.close();
        System.out.println("写出完毕");

        /*
        FileOutputStream fos = new FileOutputStream("pw.txt");
        OutputStreamWriter osw = new OutputStreamWriter(fos, StandardCharsets.UTF_8);
        BufferedWriter bw = new BufferedWriter(osw);
        bw.write("那时我放开你的手\n");
        bw.write("转过身只剩了保重");
        System.out.println("写出完毕");
        bw.close();
         */
    }
}
